/*
 * Copyright (c) 2024 - 2025 Midea Company of Midea Group.
 *
 * File Name 	    : font_manager.h
 * Description	    : 
 * Author			: huocy
 * Date	            : 2024/02/26
 * History	        : 
 */

#ifndef FONT_MANAGER_H
#define FONT_MANAGER_H

#include <stdint.h>
#include <stdlib.h>
#include <string.h>

#include "lvgl.h"

typedef enum
{
	FONT_TYPE_CN = 0,
	FONT_TYPE_LETTER,
	FONT_TYPE_DIGIT,
	FONT_TYPE_ICON,
	FONT_TYPE_BOLD
}FONT_TYPE;


#if LV_USE_FREETYPE

typedef struct
{
	FONT_TYPE type;
	uint16_t weight;    /* font size */
	uint16_t style;     /* font style */

	lv_ft_info_t* font_info;
	uint32_t refer;
}font_info_obj;

int init_font_manager(void);

lv_font_t* find_font(FONT_TYPE type, uint16_t weight);

lv_font_t* find_font_style(FONT_TYPE type, uint16_t weight, uint16_t style);

void inc_font_refer(lv_font_t* font);

void dec_font_refer(lv_font_t* font);

void clean_font_cach(void);

#endif

#endif
